package cn.iocoder.yudao.module.fengdong.smartelderly.dal.mysql.activityrecord;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.fengdong.smartelderly.dal.dataobject.activityrecord.ActivityRecordDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.fengdong.smartelderly.controller.admin.activityrecord.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 活动参加记录 Mapper
 *
 * @author 沣东养老院管理员
 */
@Mapper
public interface ActivityRecordMapper extends BaseMapperX<ActivityRecordDO> {

    default PageResult<ActivityRecordDO> selectPage(ActivityRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ActivityRecordDO>()
                .eqIfPresent(ActivityRecordDO::getActivityId, reqVO.getActivityId())
                .betweenIfPresent(ActivityRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ActivityRecordDO::getId));
    }

    default List<ActivityRecordDO> selectList(ActivityRecordExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ActivityRecordDO>()
                .eqIfPresent(ActivityRecordDO::getActivityId, reqVO.getActivityId())
                .betweenIfPresent(ActivityRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ActivityRecordDO::getId));
    }

    IPage<ActivityRecordUniteRespVO> selectActivityRecordUnite(Page<Object> objectPage, @Param("param") ActivityRecordUnitePageReqVO pageVO, @Param("loginUserId")Long loginUserId);
}
